package com.epfresh.bean;


import com.epfresh.global.CartHelper;

import java.util.List;

public class CartGood  implements CartHelper.CartHelperTools{
    private String coId;
    private double count;
    private String productPackageQuantity;
    private String productWeightUnit;
    private String productPackageContainer;
    private String specNumber;
    private String specModefiedTime;
    private String specName;

    private OfferDtoBean offerProductDto;
    private String lastestPriceUnit;

    public String getCoId() {
        return coId;
    }

    public void setCoId(String coId) {
        this.coId = coId;
    }

    public String getProductPackageQuantity() {
        return productPackageQuantity;
    }

    public void setProductPackageQuantity(String productPackageQuantity) {
        this.productPackageQuantity = productPackageQuantity;
    }

    public String getProductWeightUnit() {
        return productWeightUnit;
    }

    public void setProductWeightUnit(String productWeightUnit) {
        this.productWeightUnit = productWeightUnit;
    }

    public String getProductPackageContainer() {
        return productPackageContainer;
    }

    public void setProductPackageContainer(String productPackageContainer) {
        this.productPackageContainer = productPackageContainer;
    }

    public String getSpecNumber() {
        return specNumber;
    }

    public void setSpecNumber(String specNumber) {
        this.specNumber = specNumber;
    }

    public String getSpecModefiedTime() {
        return specModefiedTime;
    }

    public void setSpecModefiedTime(String specModefiedTime) {
        this.specModefiedTime = specModefiedTime;
    }

    public String getSpecName() {
        return specName;
    }

    public void setSpecName(String specName) {
        this.specName = specName;
    }

    public String getLastestPriceUnit() {
        return lastestPriceUnit;
    }

    public void setLastestPriceUnit(String lastestPriceUnit) {
        this.lastestPriceUnit = lastestPriceUnit;
    }

    public OfferDtoBean getOfferProductDto() {
        return offerProductDto;
    }

    public void setOfferProductDto(OfferDtoBean offerProductDto) {
        this.offerProductDto = offerProductDto;
    }

    @Override
    public String getUniqueKey() {
        return getIdPlus();
    }

    public String getIdPlus() {
        if (promotionItemId != null ){
            return id+"|"+promotionItemId;
        }
        return id;
    }
    public double getCount() {
        return productCount;
    }

    public void setCount(double count) {
        this.productCount = count;
        this.count = count;
    }
//    "productOriginalPrice" : null,
//            "productDiscountRate" : null,
//            "lastestUnitPrice" : 8.0,
//            "productTotalPrice" : 344.0,
//            "productTotalOriginalPrice" : 0.0,


    private Double productOriginalPrice;
    private Double productDiscountRate;
    private Double economizePrice;//折扣扣节省小计
    private String discountStr;//店铺折扣信息

    private String productImgUrl;
    private double productTotalPrice;
    private double productUnitPrice;
    private int cityId;
    private String pickupId;
    private String productExpressFee;
    private String imgTag;
    private double productCount;
    private String productChargeUnit;
    private Object distributionId;
    private String carNo;
    private String productGradeTitle;
    private int wholeSaleMarketId;
    private String storeName;
    private String id;
    private Object isDisabled;
    private String salesType;
    private String productVarietyTitle;
    private String productId;
    private boolean checkCityId;
    private String storeId;
    private boolean  prePrice;
    private String productTitle;
    private int accountId;
    private String productPackageSize;
    private String versionId;
    private Object productCode;
    private Object pickupAddress;
    private String createTime;
    private String productNameTitle;
    private String productSourceTitle;
    private Object distributionTitle;
    private String wholeSaleMarketName;
    private String productBrandTitle;
    private String cityName;
    private String shoppingCarId;
    private String productPriceUnit;
    private String productNameId;
    private boolean isSelect = true;
    private int isSelected = 1;
    private double minPlaceOrderValue;
    private double maxPlaceOrderValue;
    private double productDeposit;
    private int wholeSalesType = 1;
    private boolean isSelectStored;
/*    self.specId = @"";
    self.specPromotionItemId = @"";*/
    private String specId;
    private String specPromotionItemId;

    private float incr;

    private String offerText;

    public boolean isPrePrice() {
        return prePrice;
    }

    public void setPrePrice(boolean prePrice) {
        this.prePrice = prePrice;
    }

    public String getOfferText() {
        return offerText;
    }

    public void setOfferText(String offerText) {
        this.offerText = offerText;
    }

    public String getSpecId() {
        return specId;
    }

    public void setSpecId(String specId) {
        this.specId = specId;
    }

    public String getSpecPromotionItemId() {
        return specPromotionItemId;
    }

    public void setSpecPromotionItemId(String specPromotionItemId) {
        this.specPromotionItemId = specPromotionItemId;
    }


    //原价
    private double lastestUnitPrice;
    public double getLastestUnitPrice() {
        return lastestUnitPrice;
    }

    public void setLastestUnitPrice(double lastestUnitPrice) {
        this.lastestUnitPrice = lastestUnitPrice;
    }



    //留言
    private String merMsg;

    /* "promotionItemId": 683,
        "promotionId": 77,
        "promotionType": 1,
        "promotionTypeTitle": "促销",*/
    private String promotionItemId;
    private String promotionId;
    private String promotionType;
    private String promotionTypeTitle;
    private String markUrl;
    private List<HomeCommTag> tags;


    public String getMarkUrl() {
        return markUrl;
    }

    public void setMarkUrl(String markUrl) {
        this.markUrl = markUrl;
    }

    public List<HomeCommTag> getTags() {
        return tags;
    }

    public void setTags(List<HomeCommTag> tags) {
        this.tags = tags;
    }

    public String getPromotionItemId() {
        return promotionItemId;
    }

    public void setPromotionItemId(String promotionItemId) {
        this.promotionItemId = promotionItemId;
    }

    public String getPromotionId() {
        return promotionId;
    }

    public void setPromotionId(String promotionId) {
        this.promotionId = promotionId;
    }

    public String getPromotionType() {
        return promotionType;
    }

    public void setPromotionType(String promotionType) {
        this.promotionType = promotionType;
    }

    public String getPromotionTypeTitle() {
        return promotionTypeTitle;
    }

    public void setPromotionTypeTitle(String promotionTypeTitle) {
        this.promotionTypeTitle = promotionTypeTitle;
    }

    public String getProductNameId() {
        return productNameId;
    }

    public void setProductNameId(String productNameId) {
        this.productNameId = productNameId;
    }

    public String getMerMsg() {
        return merMsg;
    }

    public void setMerMsg(String merMsg) {
        this.merMsg = merMsg;
    }

    public Double getEconomizePrice() {
        return economizePrice;
    }

    public void setEconomizePrice(Double economizePrice) {
        this.economizePrice = economizePrice;
    }

    public String getDiscountStr() {
        return discountStr;
    }

    public void setDiscountStr(String discountStr) {
        this.discountStr = discountStr;
    }

    public Double getProductOriginalPrice() {
        return productOriginalPrice;
    }

    public void setProductOriginalPrice(Double productOriginalPrice) {
        this.productOriginalPrice = productOriginalPrice;
    }

    public Double getProductDiscountRate() {
        return productDiscountRate;
    }

    public void setProductDiscountRate(Double productDiscountRate) {
        this.productDiscountRate = productDiscountRate;
    }

    public String getShoppingCarId() {
        return shoppingCarId;
    }

    public void setShoppingCarId(String shoppingCarId) {
        this.shoppingCarId = shoppingCarId;
    }

    public String getProductPriceUnit() {
        return productPriceUnit;
    }

    public void setProductPriceUnit(String productPriceUnit) {
        this.productPriceUnit = productPriceUnit;
    }

    public int getWholeSalesType() {
        return wholeSalesType;
    }

    public void setWholeSalesType(int wholeSalesType) {
        this.wholeSalesType = wholeSalesType;
    }

    public double getProductDeposit() {
        return productDeposit;
    }

    public void setProductDeposit(double productDeposit) {
        this.productDeposit = productDeposit;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public double getMinPlaceOrderValue() {
        return minPlaceOrderValue < 0.01 ? 0.01 : minPlaceOrderValue;
    }

    public void setMinPlaceOrderValue(double minPlaceOrderValue) {
        this.minPlaceOrderValue = minPlaceOrderValue;
    }

    public boolean isCheckCityId() {
        return checkCityId;
    }

    public boolean isSelect() {
        return isSelected == 1;
    }

    public void setSelect(boolean select) {
        if (select) {
            isSelected = 1;
        } else {
            isSelected = 0;
        }
    }

    public String getProductImgUrl() {
        return this.productImgUrl;
    }

    public void setProductImgUrl(String productImgUrl) {
        this.productImgUrl = productImgUrl;
    }

    public double getProductTotalPrice() {
        return this.productTotalPrice;
    }

    public void setProductTotalPrice(double productTotalPrice) {
        this.productTotalPrice = productTotalPrice;
    }

    public double getProductUnitPrice() {
        return this.productUnitPrice;
    }

    public void setProductUnitPrice(double productUnitPrice) {
        this.productUnitPrice = productUnitPrice;
    }

    public int getCityId() {
        return this.cityId;
    }

    public void setCityId(int cityId) {
        this.cityId = cityId;
    }

    public Object getPickupId() {
        return this.pickupId;
    }

    public void setPickupId(String pickupId) {
        this.pickupId = pickupId;
    }

    public String getProductExpressFee() {
        return this.productExpressFee;
    }

    public void setProductExpressFee(String productExpressFee) {
        this.productExpressFee = productExpressFee;
    }

    public String getImgTag() {
        return this.imgTag;
    }

    public void setImgTag(String imgTag) {
        this.imgTag = imgTag;
    }

    public double getProductCount() {
        return this.productCount;
    }

    public void setProductCount(double productCount) {
        this.productCount = productCount;
    }

    public String getProductChargeUnit() {
        return this.productChargeUnit == null?"":productChargeUnit;
    }

    public void setProductChargeUnit(String productChargeUnit) {
        this.productChargeUnit = productChargeUnit;
    }

    public Object getDistributionId() {
        return this.distributionId;
    }

    public void setDistributionId(Object distributionId) {
        this.distributionId = distributionId;
    }

    public String getCarNo() {
        return this.carNo;
    }

    public void setCarNo(String carNo) {
        this.carNo = carNo;
    }

    public String getProductGradeTitle() {
        return this.productGradeTitle;
    }

    public void setProductGradeTitle(String productGradeTitle) {
        this.productGradeTitle = productGradeTitle;
    }

    public int getWholeSaleMarketId() {
        return this.wholeSaleMarketId;
    }

    public void setWholeSaleMarketId(int wholeSaleMarketId) {
        this.wholeSaleMarketId = wholeSaleMarketId;
    }

    public String getStoreName() {
        return this.storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Object getIsDisabled() {
        return this.isDisabled;
    }

    public void setIsDisabled(Object isDisabled) {
        this.isDisabled = isDisabled;
    }

    public String getSalesType() {
        return this.salesType;
    }

    public void setSalesType(String salesType) {
        this.salesType = salesType;
    }

    public String getProductVarietyTitle() {
        return this.productVarietyTitle;
    }

    public void setProductVarietyTitle(String productVarietyTitle) {
        this.productVarietyTitle = productVarietyTitle;
    }

    public String getProductId() {
        return this.productId;
    }

    public String getProductIdPlus() {

        if (promotionItemId != null && !"".equals(promotionItemId)) {
            return this.productId + "|" + promotionItemId;
        }
        return this.productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public boolean getCheckCityId() {
        return this.checkCityId;
    }

    public void setCheckCityId(boolean checkCityId) {
        this.checkCityId = checkCityId;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getProductTitle() {
        return this.productTitle;
    }

    public void setProductTitle(String productTitle) {
        this.productTitle = productTitle;
    }

    public int getAccountId() {
        return this.accountId;
    }

    public void setAccountId(int accountId) {
        this.accountId = accountId;
    }

    public String getProductPackageSize() {
        return this.productPackageSize;
    }

    public void setProductPackageSize(String productPackageSize) {
        this.productPackageSize = productPackageSize;
    }

    public String getVersionId() {
        return versionId;
    }

    public void setVersionId(String versionId) {
        this.versionId = versionId;
    }

    public Object getProductCode() {
        return this.productCode;
    }

    public void setProductCode(Object productCode) {
        this.productCode = productCode;
    }

    public Object getPickupAddress() {
        return this.pickupAddress;
    }

    public void setPickupAddress(Object pickupAddress) {
        this.pickupAddress = pickupAddress;
    }

    public String getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getProductNameTitle() {
        return this.productNameTitle;
    }

    public void setProductNameTitle(String productNameTitle) {
        this.productNameTitle = productNameTitle;
    }

    public String getProductSourceTitle() {
        return this.productSourceTitle;
    }

    public void setProductSourceTitle(String productSourceTitle) {
        this.productSourceTitle = productSourceTitle;
    }

    public Object getDistributionTitle() {
        return this.distributionTitle;
    }

    public void setDistributionTitle(Object distributionTitle) {
        this.distributionTitle = distributionTitle;
    }

    public String getWholeSaleMarketName() {
        return this.wholeSaleMarketName;
    }

    public void setWholeSaleMarketName(String wholeSaleMarketName) {
        this.wholeSaleMarketName = wholeSaleMarketName;
    }

    public String getProductBrandTitle() {
        return this.productBrandTitle;
    }

    public void setProductBrandTitle(String productBrandTitle) {
        this.productBrandTitle = productBrandTitle;
    }

    public double getMaxPlaceOrderValue() {
        return maxPlaceOrderValue;
    }

    public void setMaxPlaceOrderValue(double maxPlaceOrderValue) {
        this.maxPlaceOrderValue = maxPlaceOrderValue;
    }

    public int getIsSelected() {
        return isSelected;
    }

    public void setIsSelected(int isSelected) {
        this.isSelected = isSelected;
    }

    public boolean isSelectStored() {
        return isSelectStored;
    }

    public void setSelectStored(boolean selectStored) {
        isSelectStored = selectStored;
    }

    public float getIncr() {
        return incr;
    }

    public void setIncr(float incr) {
        this.incr = incr;
    }

    public String getSalePriceUnit() {
        String s = productUnitPrice + "元";
        if (productChargeUnit == null || "".equals(productChargeUnit) || "null".equals(productChargeUnit)) {

        } else {
            s += "/" + productChargeUnit;
        }
        return s;
    }

    public void storedSelect() {
        isSelectStored = isSelect();
        setSelect(false);
    }

    public void releaseSelect() {
        setSelect(isSelectStored);
    }
}
